package com.hx.xiao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hx.xiao.entity.Su;
import com.hx.xiao.entity.Taol;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface TaolMapper extends BaseMapper<Taol> {

    @Select("select id,uid,hid,taolun,phone from taol where hid= #{id}")
    List<Taol> findById(Integer id);

    @Insert("insert into taol(uid,hid,taolun,phone) values(#{uid},#{hid},#{taolun},#{phone})")
    int insertById(Taol taol);

    @Select("select id,uid,hid,taolun,phone from taol")
    List<Taol> findAll();

    @Select("select id,uid,hid,taolun,phone from taol where id= #{id}")
    Taol findBy(Integer id);

    @Delete("delete from taol where id= #{id}")
    int deleteById(Integer id);

    @Update("update taol set taolun=#{taolun} where id=#{id}")
    int updateBy(Taol taol);
}
